package request

import (
	"net/http"
)

type Request struct {
	url string
	respType string
	method string
	postdata string
	urltag string
	header http.Header
	cookies []*http.Cookie
	checkRedirect func(req *http.Request, via []*http.Request) error
	meta interface{}
}


func NewRequest(url string,
	respType string,
	urltag string,
	method string,
	postdata string,
	header http.Header,
	cookies []*http.Cookie,
	checkRedirect func(req *http.Request, via []*http.Request) error,
	meta interface{}) *Request{

	return &Request{url,respType,method,postdata,urltag,
		header,cookies,checkRedirect,meta}
}

func (this *Request) GetUrl() string{
	return this.url
}

func (this *Request) GetUrlTag() string{
	return this.urltag
}

func (this *Request) GetMethod() string{
	return this.method
}

func (this *Request) GetPostdata() string{
	return this.postdata
}
func (this *Request) GetHeader() http.Header{
	return this.header
}
func (this *Request) GetCookies() []*http.Cookie{
	return this.cookies
}
func (this *Request) GetReponseType() string{
	return this.respType
}
func (this *Request) GetRedirectFunc() func(req *http.Request, via []*http.Request) error{
	return this.checkRedirect
}

func (this *Request) GetMeta() interface{}{
	return this.meta
}